package com.aspose.cells;

class zbxs extends zcdb {
   zbxs(PivotField var1) throws Exception {
      this.d = 285;
      int var2 = 20;
      byte[] var10000 = new byte[]{-1, -1, -1, -1};
      String var4 = var1.getDisplayName();
      if (var4 != null) {
         var2 += var4.length() * 2 + 4;
      }

      this.c = new byte[var2];
      boolean var5 = false;
      byte var6 = 0;
      short var7 = 0;
      short var8 = 0;
      switch(var1.m) {
      case 1:
         if (var1.h()) {
            this.c[0] = 9;
         } else {
            this.c[0] = 1;
         }
         break;
      case 2:
         if (var1.h()) {
            this.c[0] = 10;
         } else {
            this.c[0] = 2;
         }
         break;
      case 3:
      case 5:
      case 6:
      case 7:
      default:
         if (var1.h()) {
            this.c[0] = 8;
         }
         break;
      case 4:
         if (var1.h()) {
            this.c[0] = 12;
         } else {
            this.c[0] = 4;
         }
         break;
      case 8:
         this.c[0] = 8;
      }

      short var10 = (short)(var1.b.a & '\uffff');
      if (var1.getShowCompact()) {
         var6 = (byte)(var6 | 16);
      }

      if (var1.getDisplayName() != null) {
         var6 = (byte)(var6 | 32);
      }

      if (var1.p) {
         var6 = (byte)(var6 | 128);
      }

      if (var1.getDragToRow()) {
         var7 = (short)(var7 | 1);
      }

      if (var1.getDragToColumn()) {
         var7 = (short)(var7 | 2);
      }

      if (var1.getDragToPage()) {
         var7 = (short)(var7 | 4);
      }

      if (var1.getDragToHide()) {
         var7 = (short)(var7 | 8);
      }

      if (var1.getDragToData()) {
         var7 = (short)(var7 | 16);
      }

      if (var1.getShowAllItems()) {
         var7 = (short)(var7 | 32);
      }

      if (var1.getShowInOutlineForm()) {
         var7 = (short)(var7 | 64);
      }

      if (var1.getInsertBlankRow()) {
         var7 = (short)(var7 | 128);
      }

      if (var1.getShowSubtotalAtTop()) {
         var7 = (short)(var7 | 256);
      }

      if (var1.isInsertPageBreaksBetweenItems()) {
         var7 = (short)(var7 | 2048);
      }

      if (var1.isAutoSort()) {
         var7 = (short)(var7 | 4096);
      }

      if (var1.isAscendSort()) {
         var7 = (short)(var7 | 8192);
      }

      if (var1.isAutoShow()) {
         var7 = (short)(var7 | 16384);
      }

      if (var1.isAscendShow()) {
         var7 |= -32768;
      }

      if (!var1.isIncludeNewItemsInFilter()) {
         var8 = (short)(var8 | 4);
      }

      if (var1.isMultipleItemSelectionAllowed()) {
         var8 = (short)(var8 | 8);
      }

      System.arraycopy(com.aspose.cells.b.a.zc.a(var10), 0, this.c, 1, 2);
      this.c[3] = var6;
      System.arraycopy(com.aspose.cells.b.a.zc.a((int)var1.c.d), 0, this.c, 4, 4);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, this.c, 8, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var8), 0, this.c, 10, 2);
      if (var1.isAutoShow()) {
         System.arraycopy(com.aspose.cells.b.a.zc.a(var1.getAutoShowCount()), 0, this.c, 12, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)-1), 0, this.c, 16, 4);
      } else {
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)10), 0, this.c, 12, 4);
         System.arraycopy(com.aspose.cells.b.a.zc.a((int)-1), 0, this.c, 16, 4);
      }

      byte var9 = 20;
      var4 = var1.getDisplayName();
      if (var4 != null) {
         zcch.a(this.c, var9, var4);
      }

   }
}
